-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reorganize repo (headers moved to src/, bindings/ and examples/ made root-level dirs) & update build system #582
Conversation
- src/bindings/ moves to /bindings/ - src/examples/ moves to /examples/ - Contents of include/ merged into src/ with same hierarchy - src/Qt/demo/ moves to examples/qt-demo/
FindOpenShotAudio.cmake: Enhance with targets - Also, migrate as much config as possible from CMakeLists.txt files to properties of IMPORTED OpenShot::Audio target (including platform- specific configs)
- Also, add missing ENABLE_COVERAGE option(), tweak option processing
Ruby: Relax SWIG version for compatibility check - Turns out the Ruby-2.7.0-compatibility commit made it into SWIG 4.0.2 Ruby bindings: Fix all kinds of brokenness - Turns out int64_t function args require stdint.i for auto-conversion. - The imported module name is (still) 'Openshot' — lowercase 's'. - #TIL that accidentally dropping the OUTPUT_NAME config leads to a non-loadable shared library, due to the filename being wrong.
- Parameters assigned to ImageMagick::Magick++ will now follow the 'openshot' shared-library target wherever it's linked, even in build subdirectories that aren't children or siblings of the location where the target was created. - Removed the redundant code duplicating `find_package(ImageMagick)` checks. Multiple dependency scans have only been necessary as a workaround to overcome CMake variables' restricted scope. Targets do not share that limitation.
- FindOpenShotAudio takes over -DDEBUG, -DHAVE_ISFINITE logic (now set on OpenShot::Audio target when appropriate) - Tweaks to BlackMagic dependency discovery - Reverse the test-disabling logic, `DISABLE_TESTS FALSE` cache variable changed to `ENABLE_TESTS TRUE`
Codecov Report
@@ Coverage Diff @@
## develop #582 +/- ##
========================================
Coverage 49.44% 49.45%
========================================
Files 129 129
Lines 10263 10261 -2
========================================
Hits 5075 5075
+ Misses 5188 5186 -2
Continue to review full report at Codecov.
|
84b296a
to
1df8563
Compare
1df8563
to
b741eff
Compare
@ferdnyc Not sure how this already has 2 conflicts, lol |
If we are gonna do it... then let's go for it. As mentioned before, I don't have any strong opinions related to where header files live. I know convention is strong, and the include folder is a common pattern, but I do agree it makes things simpler to keep them together, and distribute them the same as we do now. I like it! Let's merge. |
But I'll let you merge this one... so I can stand out of the blast radius. lol |
b741eff
to
1f9e4e2
Compare
...WTH did I just do!? |
Well, that was fun. Managed to briefly wipe out the entire branch with a bad |
All passed except the Gitlab Mac builder, which was stuck in previous jobs waiting on Apple. It's only just started building this branch now, but I'mma wait on it just to be really sure. |
Huzzah! Here goes.... everything. Boom. 💥 |
REALLY IMPORTANT BIT
This PR is a resurrection of #504. The headline is that it moves all of libopenshot's headers out of the
include/
directory, and places them all in thesrc/
directory alongside their implementation files. (The hierarchy is preserved:include/Qt/*
moves tosrc/Qt
, etc.) Meanwhile, thebindings/
andexamples/
subdirectories are moved out ofsrc/
and placed at the root of the repo.To read my justification for this change, along with reasons why I feel it's worth the upheaval it will cause, see my initial proposal in issue #471.
(This PR thus: Fixes #471, though that issue's already been closed by the Stale bot.)
Slightly less important bit (with some additional details)
The original PR also had to be closed, but in that case it was due to the difficulties we encountered trying to reconcile it with the current repo state in the wake of several weeks' worth of other changes to
develop
. As such, this PR is being fast-tracked to merge quickly, pretty much as soon as it passes the necessary checks (and before any other changes land indevelop
). The hope is that this will help prevent the conflicts that would inevitably arise if any other changes are merged. @jonoomph has already signed off (in #504) on the concept of these changes, it's just a question of creating the opportunity to make them.Given that this PR touches very nearly every source file in the repository, merging it will most likely result in conflicts appearing in many or all of the other open PRs. That's unfortunate, but also unavoidable given the nature of these changes.
After the merge, I will attempt to resolve any open PR conflicts on behalf of their submitters. There may be some I'm not able to sort out on my own, though, and I'll be forced to leave their resolution to the author. In addition, if anyone has local changes on a PR branch that they haven't yet pushed to Github, merging this PR will probably make that process messier and more complicated. Either way, I apologize in advance for this one-time disruption.
Just wanted to preemptively bring this impending codepocalypse to everyone's attention. #YouHaveBeenWarned
Courtesy-tagging submitters of all open PRs: @ckirmse @jonoomph @kartchnb @musteresel @chad3814 @PhysSong @aopa-frogslayer @kirillmakhonin.
Not at all important bit (with excessive details regarding the specifics of the PR)
From the original PR description:
I actually didn't do that, this time. It's still a good idea, I just left it out of the changes in the new branch. Perhaps I'll add it in before merge.
In addition, enhancements are made to the build system:
FindOpenShotAudio.cmake
now creates anIMPORTED
targetOpenShot::Audio
to hold all of its configs. The configs are also still supplied in variables likeOpenShotAudio_INCLUDE_DIRS
,OpenShotAudio_LIBRARIES
, etc., but the oldLIBOPENSHOT_AUDIO_INCLUDE_DIRS
and etc. variables are completely gone. The strongly recommended method of consuming the results offind_package(OpenShotAudio)
is via theOpenShot::Audio
IMPORTED
target.One reason
OpenShot::Audio
is preferred: that target (and only the target) now incorporates all of the additional/conditional build configuration relating to libopenshot-audio. This includes things like defining theHAVE_ISFINITE
andIGNORE_JUCE_HYPOT
macros, the extra DLL/framework linked into libopenshot on Win32 and MacOS platforms, and some compile options that need to be set in various scenarios. All of that logic used to be scattered around the variousCMakeLists.txt
files, but it's now all been consolidated as part ofFindOpenShotAudio.cmake
. The module exports all relevant configuration in the form of properties applied to theOpenShot::Audio
target.When
src/CMakeLists.txt
detects a successfulfind_package(ImageMagick...)
check, it now creates a targetImageMagick::Magick++
and applies the necessary package configuration by setting properties on that target. (Actually, it creates a targetMagick++_TARGET
, then aliasesImageMagick::Magick++
to that target. The "whys" of that are nebulous, uninteresting, and best chalked up to "CMake nonsense" and left at that.)target_link_libraries(openshot PUBLIC ImageMagick::Magick++)
then attaches all of that configuration to the libopenshot library build.The reason for all of these newly-added targets is, it allows us to take advantage of automatic config propagation across the entire build system. Previously,
tests/CMakeLists.txt
had to duplicate some of the configuration fromsrc/CMakeLists.txt
, because non-target configs were limited to thesrc/
directory (and subdirectory) context. And while the non-target configs were previously available tosrc/bindings/*/CMakeLists.txt
as subdirectories ofsrc/
(andsrc/examples/
was configured bysrc/CMakeLists.txt
), now that those directories are moved out ofsrc/
and have their ownCMakeLists.txt
files that's no longer the case.CMake targets are global by definition, so any build configuration done in
src/CMakeLists.txt
by means of target properties will automatically be propagated totests/
,bindings/
andexamples/
without the need for any redundant code. This makes theCMakeLists.txt
files in those directories less complex, while at the same time making the overall build system more resilient and predictable since it's no longer possible forCMakeLists.txt
inconsistencies to cause config changes from directory to directory.The now-redundant configuration previously being (re-)done in
tests/CMakeLists.txt
has been removed. (The sole exception to this is the optional DeckLink BlackMagic integration, which for the moment is still done via legacy non-target configs and therefore still has some minor duplication.)A couple of other minor changes are also included:
In testing
examples/Example.rb
I unearthed several bugs in our Ruby support, from code errors in that example file to build-configuration errors inbindings/ruby/CMakeLists.txt
. This PR fixes all of those bugs, and after applying those fixes I was able to runExample.rb
with Fedora'sruby
command and have it display the image retrieved viaGetFrame()
as expected.I renamed the
MappedMetadata
typedef toMetadataMap
in the SWIG interface files, simply because it's the proper name based on the pattern established by the surrounding code. That change shouldn't affect any code, as those typedefs are only used in the generated SWIG code and aren't typically accessed directly. (The names are exported in the SWIG-generated bindings, though, so it's possible some code out there makes use of the bindings in some esoteric way that involves directly referencing the Python classopenshot.MappedMetadata
. If so, then the rename toopenshot.MetadataMap
breaks that code, and you have my apologies.)